<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>react-water</title>
</head>


<body>
    <div id="root"></div>
</body>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
<script type="text/babel">
    class Water extends React.Component {
        constructor(props) {
            super(props);
            this.state = {
                temperature: ''
            };
            this.isTemp = this.isTemp.bind(this)
        }
        isTemp(e) {
            this.setState({
                temperature: e.target.value
            })
        }
        render() {
            return (
                <div>
                    <h1>请输入此时水的温度</h1>
                    <p><b>{this.state.temperature >= 100 ? "(*^▽^*)水烧开了" : "(ಥ﹏ಥ)水没烧开"}</b></p>
                    <input onChange={this.isTemp} value={this.state.temperature} />
                </div>
            );
        }
    }

    ReactDOM.render(
        <Water />,
        document.getElementById('root')
    );

</script>

</html>